package com.jomoo.css.common.core.util.reflect.criteria.expression;

import com.jomoo.css.common.core.util.reflect.filter.PropertyFilter;

import java.beans.PropertyDescriptor;
import java.util.List;


public class IgnoreValuesExpression implements PropertyExpression {

    private List<Object> values;

    public IgnoreValuesExpression(List<Object> values) {
        super();
        this.values = values;
    }


    public PropertyFilter toFilter() {
        return new PropertyFilter() {

            public boolean isPermit(PropertyDescriptor property, Object object) {
                if (values.contains(object)) {
                    return false;
                }
                return true;
            }

        };
    }

}
